<template>
  <div class="app">
    <!-- 图片懒加载组件  
    src源图片 
    placeholder占位小图片 
    transitionMs占位图片与源图片切换时间 
    load图片加载完成后执行函数-->
    
    <ImgLoader
      src="http://www.lv666.top/IMG/1619605706962_0.1fhmcljdolt.jpg"
      placeholder="http://www.lv666.top/IMG/1619605775108_0.60wmvmw4q3j.jpg"
      :transitionMs="time"
      @load="imgSrcLoader"
    />
  </div>
</template>

<script>
import ImgLoader from "./index";
export default {
  components: {
    ImgLoader,
  },
  methods: {
    imgSrcLoader() {
      console.log("图片加载完成");
    },
  },
  data() {
    return {
      time: 500,
    };
  },
};
</script>

<style lang="less" scope>
.app {
  width: 1000px;
  height: 400px;
}
</style>
